package com.ruoyi.docdraw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.docdraw.mapper.SysDocDrawMapper;
import com.ruoyi.docdraw.domain.SysDocDraw;
import com.ruoyi.docdraw.service.ISysDocDrawService;

/**
 * 文档图纸Service业务层处理
 * 
 * @author lvtian
 * @date 2025-02-26
 */
@Service
public class SysDocDrawServiceImpl implements ISysDocDrawService 
{
    @Autowired
    private SysDocDrawMapper sysDocDrawMapper;

    /**
     * 查询文档图纸
     * 
     * @param drawId 文档图纸主键
     * @return 文档图纸
     */
    @Override
    public SysDocDraw selectSysDocDrawByDrawId(Long drawId)
    {
        return sysDocDrawMapper.selectSysDocDrawByDrawId(drawId);
    }

    /**
     * 查询文档图纸列表
     * 
     * @param sysDocDraw 文档图纸
     * @return 文档图纸
     */
    @Override
    public List<SysDocDraw> selectSysDocDrawList(SysDocDraw sysDocDraw)
    {
        return sysDocDrawMapper.selectSysDocDrawList(sysDocDraw);
    }

    /**
     * 新增文档图纸
     * 
     * @param sysDocDraw 文档图纸
     * @return 结果
     */
    @Override
    public int insertSysDocDraw(SysDocDraw sysDocDraw)
    {
//        sysDocDraw.setCreateTime(DateUtils.getNowDate());
        return sysDocDrawMapper.insertSysDocDraw(sysDocDraw);
    }

    /**
     * 修改文档图纸
     * 
     * @param sysDocDraw 文档图纸
     * @return 结果
     */
    @Override
    public int updateSysDocDraw(SysDocDraw sysDocDraw)
    {
//        sysDocDraw.setUpdateTime(DateUtils.getNowDate());
        return sysDocDrawMapper.updateSysDocDraw(sysDocDraw);
    }

    /**
     * 批量删除文档图纸
     * 
     * @param drawIds 需要删除的文档图纸主键
     * @return 结果
     */
    @Override
    public int deleteSysDocDrawByDrawIds(Long[] drawIds)
    {
        return sysDocDrawMapper.deleteSysDocDrawByDrawIds(drawIds);
    }

    /**
     * 删除文档图纸信息
     * 
     * @param drawId 文档图纸主键
     * @return 结果
     */
    @Override
    public int deleteSysDocDrawByDrawId(Long drawId)
    {
        return sysDocDrawMapper.deleteSysDocDrawByDrawId(drawId);
    }


    @Override
    public int batchInsertSysDocDraw(List<SysDocDraw> drawList) {
        return sysDocDrawMapper.batchInsertSysDocDraw(drawList);
    }


    @Override
    public int deleteSysDocDrawByDocId(Long docId) {
        return sysDocDrawMapper.deleteSysDocDrawByDocId(docId);
    }
}
